﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BCCommon;
using BCCommon.OAEnums.TeamWork;
using BCDto.OA.Common;
using BCDto.OA.TeamWork.TeamWork;
using BCDto.OA.TeamWork.TeamWorkParticipant;
using BCDto.OA.TeamWork.TeamWorkReply;

namespace BCService.OA.TeamWork.TeamWorkService
{
    /// <summary>
    /// 协同办公
    /// </summary>
    public interface ITeamWorkService
    {
        /// <summary>
        /// 添加协同办公
        /// </summary>
        /// <param name="requestDto">协同办公信息</param>
        TeamWorkDto Add(TeamWorkRequestDto requestDto);
        /// <summary>
        /// 更新协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        /// <param name="requestDto">协同办公信息</param>
        TeamWorkDto Update(long teamWorkId, TeamWorkRequestDto requestDto);
        /// <summary>
        /// 完成协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        /// <param name="requestDto">处理信息</param>
        /// <returns></returns>
        TeamWorkDto UpdateFinish(long teamWorkId, RemarkRequestDto requestDto);
        /// <summary>
        /// 关闭协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        /// <param name="requestDto">处理信息</param>
        /// <returns></returns>
        TeamWorkDto UpdateClose(long teamWorkId, RemarkRequestDto requestDto);
        /// <summary>
        /// 删除协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        bool Delete(long teamWorkId);
        /// <summary>
        /// 获取协同办公
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        TeamWorkViewDto GetEntity(long teamWorkId);
        /// <summary>
        /// 获取协同办公列表
        /// </summary>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        IEnumerable<TeamWorkViewDto> GetList(string teamWorkCategoryCode, DateTime? start, DateTime? end);
        /// <summary>
        /// 获取协同办公任务总数量
        /// </summary>
        /// <param name="participantId">参与人Id</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <returns></returns>
        int GetProcessingCount(long participantId, string teamWorkCategoryCode);
        /// <summary>
        /// 获取协同办公分页列表
        /// </summary>
        /// <param name="referenceNo">引用编号</param>
        /// <param name="workTitle">工作标题</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="workStatus">工作状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">协同办公每页数据条数</param>
        PageableList<TeamWorkViewDto> Query(string referenceNo, string workTitle, string teamWorkCategoryCode, OAWorkStatus? workStatus, DateTime? start, DateTime? end, int pageIndex, int pageSize);
        /// <summary>
        /// 获取协同办公分页列表
        /// </summary>
        /// <param name="participantId">参与人Id</param>
        /// <param name="teamWorkCategoryCode">协同办公分类编码</param>
        /// <param name="workStatus">工作状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">协同办公每页数据条数</param>
        PageableList<TeamWorkViewDto> Query(long participantId, string teamWorkCategoryCode, OAWorkStatus? workStatus, DateTime? start, DateTime? end, int pageIndex, int pageSize);
        /// <summary>
        /// 获取参与人列表
        /// </summary>
        /// <param name="teamWorkId">协同办公任务Id</param>
        /// <returns></returns>
        IEnumerable<TeamWorkParticipantDto> GetParticipantList(long teamWorkId);
        /// <summary>
        /// 追加协同办公参与者
        /// </summary>
        /// <param name="teamWorkId">协同办公任务Id</param>
        /// <param name="requestDtos">协同办公参与者信息列表</param>
        IEnumerable<TeamWorkParticipantDto> AppendParticipant(long teamWorkId, List<TeamWorkParticipantRequestDto> requestDtos);
        /// <summary>
        /// 删除协同办公参与者
        /// </summary>
        /// <param name="teamWorkParticipantId">协同办公参与者Id</param>
        /// <returns></returns>
        bool DeleteParticipant(long teamWorkParticipantId);
        /// <summary>
        /// 添加协同办公回复记录
        /// </summary>
        /// <param name="teamWorkReplyRequestDto">回复信息</param>
        /// <returns></returns>
        TeamWorkReplyDto AddReply(TeamWorkReplyRequestDto teamWorkReplyRequestDto);
        /// <summary>
        /// 获取协同办公回复列表
        /// </summary>
        /// <param name="teamWorkId">协同办公任务Id</param>
        IEnumerable<TeamWorkReplyDto> GetReplyList(long teamWorkId);
    }
}